
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';

class SideMenu extends StatefulWidget{
  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return SideMenuState();
  }
  
}

class SideMenuState extends State{
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Drawer(
        child: Column(
          children: <Widget>[
            UserAccountsDrawerHeader(
              accountEmail: Text('zyy_13579@163.com'),
              accountName: Text('zyy'),
              currentAccountPicture: CircleAvatar(
                backgroundImage: AssetImage('images/lake.jpeg'),
              ),
            ),
            Padding(
              padding: EdgeInsets.only(top:20),
            ),
            ListTile(
              leading: Icon(FontAwesomeIcons.list),
              title: Text("列表页"),
              trailing: Chip(
                label:Text('123'),
                backgroundColor: Colors.blue[100],
              ),
              onTap: (){
                Navigator.pushNamed(context, '/listPage');
              },
            ),
            ListTile(
              leading: Icon(FontAwesomeIcons.water),
              title: Text("天气"),
              onTap: (){
                Navigator.pushNamed(context, '/weatherPage');
              },
            ),
            ListTile(
              leading: Icon(Icons.dashboard),
              title: Text('仪表盘'),
              onTap: (){
                Navigator.pushNamed(context, '/dashboardPage');
              },
            ),
            ListTile(
              leading: Icon(Icons.network_wifi),
              title: Text('WebView'),
              onTap: (){
                Navigator.pushNamed(context, '/webviewPage');
              },
            ),
            ListTile(
              leading: Icon(Icons.camera),
              title: Text('Camera'),
              onTap: (){
                Navigator.pushNamed(context, '/cameraPage');
              },
            ),
            Divider(),
            Expanded(
              child: Align(
                alignment: FractionalOffset.bottomCenter,
                child: ListTile(
                  leading: Icon(Icons.settings),
                  title: Text("设置"),
                  onTap: (){
                    Navigator.pushNamed(context, '/logoutPage');
                  },
                ),
              )
            ),
          ]
        ),
      );
  }
  
}